package com.sinochem.yunlian.ship.common.enums;

import lombok.Getter;

/**
 * @Auther: zzd
 * @Dscription:
 * @Date: Create in 2017/11/20 16:05
 **/
public enum WaybillStatus {

    WAITING_DISTRI(0 , "待分配"),
    DISTRING(1,"已分配"),
    EXECUTING(2 , "执行中"),
    COMPLETED(3 , "已关闭"),
    CANCEL(4 , "已取消");

    @Getter
    private int code;
    @Getter
    private String name;

     WaybillStatus(int code, String name){
         this.code = code;
         this.name = name;
    }

    public static String valueOf(int code){
         switch (code){
             case 0 :
                 return WAITING_DISTRI.name;
             case 1 :
                 return DISTRING.name;
             case 2 :
                 return EXECUTING.name;
             case 3 :
                 return COMPLETED.name;
             case 4 :
                 return CANCEL.name;
         }
         return "";
    }

}
